
FROM ubuntu:22.04


## 安装java
ADD jdk-11.0.18_linux-x64_bin.tar.gz  /usr/local/
ENV JAVA_HOME /usr/local/jdk-11.0.18
# ENV CLASSPATH $JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
ENV PATH $PATH:$JAVA_HOME/bin
RUN java -version


## 安装activemq
RUN mkdir /usr/local/artemis_installer
# RUN mkdir /usr/local/artemis
ADD apache-artemis-2.28.0-bin.tar.gz /usr/local/artemis_installer
# RUN ./usr/local/artemis_installer/apache-artemis-2.28.0/bin/artemis create /usr/local/artemis --user admin --password admin  --allow-anonymous
RUN ./usr/local/artemis_installer/apache-artemis-2.28.0/bin/artemis create --http-host 0.0.0.0 --password Gonsin123 --user admin --allow-anonymous /home/artemis 
ENV ARTEMIS_INSTANCE /usr/local/artemis
COPY jolokia-access.xml //home/artemis/etc/jolokia-access.xml
# COPY bootstrap.xml /usr/local/artemis/etc/bootstrap.xml
ENV PATH $PATH:$ARTEMIS_INSTANCE/bin

# RUN mkdir /home/artemis/
# RUN artemis create --http-host 0.0.0.0 --password Gonsin123 --user admin --require-login /home/artemis 
# RUN ./home/artemis/bin/artemis.sh run



WORKDIR /home/artemis


COPY start.sh /usr/local/bin/start.sh
RUN chmod 777 /usr/local/bin/start.sh
CMD [ "/home/artemis/bin/artemis", "run"]
# CMD [ "artemis", "run"]
